/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tt.cards.Client.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author ylevkovych
 */
@Entity
public class ClientParameter implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="RECORDDATE")
    private Date recordDate;
    @Column(name="LEGALADDRESS")
    private String legalAddress;
    @Column(name="POSTADDRESS")
    private String postAddress;
    @Column(name="AGREEMENTNUM")
    private String agreementNum;
    @Temporal(TemporalType.DATE)
    @Column(name="AGREEMENTDATE")
    private Date agreementDate;
    @Temporal(TemporalType.DATE)
    @Column(name="AGREEMENTDATEEXP")
    private Date agreementDateExp;
    @Column(name="PAYMENTEXP")
    private String paymentExp;
    @Column(name="PHONES")
    private String phones;
    @ManyToOne
    @JoinColumn(name="SUPPLIERID")
    private Client client;
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getAgreementDate() {
        return agreementDate;
    }

    public void setAgreementDate(Date agreementDate) {
        this.agreementDate = agreementDate;
    }

    public Date getAgreementDateExp() {
        return agreementDateExp;
    }

    public void setAgreementDateExp(Date agreementDateExp) {
        this.agreementDateExp = agreementDateExp;
    }

    public String getAgreementNum() {
        return agreementNum;
    }

    public void setAgreementNum(String agreementNum) {
        this.agreementNum = agreementNum;
    }

    public Client getClient() {
        return client;
    }

    public void setClient(Client client) {
        this.client = client;
    }

    public String getLegalAddress() {
        return legalAddress;
    }

    public void setLegalAddress(String legalAddress) {
        this.legalAddress = legalAddress;
    }

    public String getPaymentExp() {
        return paymentExp;
    }

    public void setPaymentExp(String paymentExp) {
        this.paymentExp = paymentExp;
    }

    public String getPhones() {
        return phones;
    }

    public void setPhones(String phones) {
        this.phones = phones;
    }

    public String getPostAddress() {
        return postAddress;
    }

    public void setPostAddress(String postAddress) {
        this.postAddress = postAddress;
    }

    public Date getRecordDate() {
        return recordDate;
    }

    public void setRecordDate(Date recordDate) {
        this.recordDate = recordDate;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ClientParameter)) {
            return false;
        }
        ClientParameter other = (ClientParameter) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return recordDate.toString();
    }
    
}
